import { Injectable } from '@angular/core';
import { SERVERS_NAME } from '../../../config/config';
import { HttpService } from '../../../core/http.service';
import { CommHttpService } from '../../../core/comm.http.service';

@Injectable()
export class LogsService extends CommHttpService {

  protected preUrl = `${SERVERS_NAME.SECURITY_SERVER}sys/log/`;

  constructor(protected http: HttpService) {
    super(http);
  }

  /**
   * 导出Excel
   *
   * @param data data
   * @returns {Observable<any>} 返回值
   */
  exportExcel(data) {
    return this.http.post(data, `${SERVERS_NAME.SECURITY_SERVER}` + 'sys/teacher/exportExcel');
  }

  /**
   * 导入Excel
   *
   * @param fileId Excel文件id
   * @returns {Observable<any>} 返回值
   */
  importExcel(data) {
    return this.http.postFile(data, `${SERVERS_NAME.SECURITY_SERVER}` + 'sys/teacher/importExcel');
  }
}
